home *** CD-ROM | disk | FTP | other *** search
/ Aminet 33 / Aminet 33 - October 1999.iso / Aminet / dev / c / ged6indent.readme < prev    next >
Encoding:
Text File  |  1999-09-06  |  6.2 KB  |  203 lines

  1. Short:    Indent C source code in GoldEd6
  2. Author:   Thomas Aglassinger <agi@giga.or.at>
  3. Uploader: Thomas Aglassinger <agi@giga.or.at>
  4. Version:  1.3
  5. Type:     dev/c
  6. Kurz:     C-Quellcode in GoldEd6 einrücken
  7. Requires: GoldEd 6.x, GNUindent
  8.  
  9. TITLE
  10.  
  11.   ged6indent
  12.  
  13. VERSION
  14.  
  15.   1.3
  16.  
  17. AUTHOR
  18.  
  19.   Thomas Aglassinger <agi@giga.or.at>
  20.  
  21. DESCRIPTION
  22.  
  23.   Ged6indent is an ARexx-script which indents a C-source currently
  24.   displayed in GoldEd by using GNUindent.
  25.  
  26. FEATURES
  27.  
  28.   None; simply does its job.
  29.  
  30. SPECIAL REQUIREMENTS
  31.  
  32.   o GoldEd, release 6.x (http://members.tripod.com/golded/)
  33.   o GNUindent (aminet:dev/c/Indent191.lha)
  34.  
  35. AVAILABILITY
  36.  
  37.   aminet:dev/c/ged6indent.lha
  38.  
  39. PRICE
  40.  
  41.   Freeware
  42.  
  43. DISTRIBUTABILITY
  44.  
  45.   Public Domain.
  46.  
  47. DISCLAIMER
  48.  
  49.   No responsibilities are taken for trashed sources, damaged Amigas
  50.   or any other components or data involved while using ged6indent.
  51.  
  52. CREDITS
  53.  
  54.   This script is based on material written by Michael Bauer. His
  55.   scripts are available from `aminet:dev/c/GEDindent.lha', but
  56.   do no longer work with GoldEd, release 6.
  57.  
  58.   An older version of the script that works with GoldEd, release 6,
  59.   can be found in `aminet:dev/c/ged6indent.lha'.
  60.  
  61.   There is also a related tool in `aminet:text/edit/Smartindent.lha',
  62.   indenting your code online - not only on request like this script.
  63.   Maybe you prefer this approach.
  64.  
  65. INSTALLATION
  66.  
  67.   Copy the ARexx-script `ged6indent.ged' to `GoldEd:ARexx/', and
  68.   build up a new menu entry for it, for example:
  69.  
  70.   COMMAND: GoldEd:Arexx/ged6indent.ged
  71.   TYPE   : Arexx
  72.   OUTPUT : CON:0/2048/384/128/Indent/AUTO/WAIT/CLOSE/SCREEN*
  73.  
  74.   Error messages will then appear at the bottom of the front-most
  75.   screen, which should be the screen of GoldEd.
  76.  
  77. CONFIGURATION
  78.  
  79.   By default, `indent' will be invoked using options matching the
  80.   style GoldEd supports in its initial configuration. If you do not
  81.   like this style, you can set an environment variable named
  82.   `ged6indent.prefs' with your preferred style, for example:
  83.  
  84.     setenv ged6indent.prefs "-bl -bli0 -i4 -sob -sc -npsl -npcs -lp"
  85.  
  86.   You can add a line like the above to your s:user-startup.
  87.  
  88.   Refer to the manual of indent for the meaning of these options.
  89.  
  90. ERROR HANDLING
  91.  
  92.   In case of `indent' shows up any error messages, a window will open
  93.   and display these messages. The source code in the current editor
  94.   window remains untouched.
  95.  
  96.   But usually the message reported by `indent' are not of much use.
  97.   You better run a compiler on your faulty source code to find out
  98.   details.
  99.  
  100. INDENTING A SINGLE FUNCTION
  101.  
  102.   If you do not want to indent the whole file, but just the function
  103.   the cursor currently is on, there is a second script included called
  104.   `ged6findent.ged'.
  105.  
  106.   To find the beginning of the current function, it searches backwards
  107.   for a `{' at the first column of a line. If found, it searches for
  108.   the corresponding `}' and marks the text in between.
  109.  
  110.   This block is written to a temporary file, processed by `indent' and
  111.   reloaded again. Because of the block operations, there will be some
  112.   flickering on the screen.
  113.  
  114.   Installation and configuration also work as described above.
  115.  
  116. PROBLEMS
  117.  
  118.   The version of `indent' included on the Geek Gadgets always opens an
  119.   output window on the screen, even if `indent' does not show any
  120.   messages. I do not know why exactly, but it seems to be related to
  121.   the way ixemul.library handles the `stdout' stream. To avoid this,
  122.   use the SAS-compiled port in aminet:dev/c/Indent191.lha.
  123.  
  124.   For `ged6findent.ged' it is important that the first curly brace
  125.   (`{') of the function is in the first column of a line. This means,
  126.   if you think you have to use a style like
  127.  
  128.     int sepp(char *hugo) {
  129.       ....
  130.     }
  131.  
  132.   the script will be unable to determine where the function starts.
  133.   Instead, you have to use
  134.  
  135.     int sepp(char *hugo)
  136.     {
  137.       ....
  138.     }
  139.  
  140.   to make it work properly.
  141.  
  142.   Because `ged6findent.ged' uses the internal bracket matching
  143.   routines of GoldEd, it also has the same quirks. For example,
  144.  
  145.   void sepp(int x)
  146.   {
  147.       if (x) {
  148.           printf("\"}");
  149.       }
  150.   }
  151.  
  152.   will not work. This is because bracket matching in GoldEd does not
  153.   care about which language the code is written in, and therefore does
  154.   not recognise the escaped `\"'.
  155.  
  156.   As a workaround, you can use the global `ged6indent.ged' for code
  157.   that contains fragments like the above.
  158.  
  159. HISTORY
  160.  
  161.   v1.3, 5-Aug-1999
  162.   - basically took `ged4indent.lha' and replaced all 4's by 6's
  163.   - renamed ged4indent.prefs to ged6indent.prefs; if you are upgrading
  164.     from the old v4 script, remember to change a possible `setenv' in
  165.     your s:user-startup
  166.   - replaced PING/PONG by QUERY LINE/GOTO LINE due to GoldEd6's new
  167.     behavior of purging PING-information after loading a file. The
  168.     column is not restored anymore. Instead, the cursor jumps to the
  169.     beginning of the line (using GOTO INDENT).
  170.   - `ged6findent.ged' now restores the find string, so the find
  171.     requester does not display a `{' to the user the next time he
  172.     wants to search the text.
  173.   - added status message "Reformatting..." while script is running
  174.   - fixed a typo in one of the requester texts
  175.  
  176.   v1.2, 25-Sep-1997
  177.   - added `ged4findent.ged' which indents only the current function
  178.   - temporary files are always removed, even in case of error
  179.   - cursor position is always restored, even in case of error
  180.  
  181.   v1.1, 11-Jun-1997
  182.   - added support for environment variable `ged4indent.prefs'
  183.   - indented version is first created in a temporary file, and only
  184.     read into editor again if no error occurred
  185.  
  186.   v1.0, 26-Jan-1997
  187.   - initial release
  188.  
  189.  
  190. ============================= Archive contents =============================
  191.  
  192. Original  Packed Ratio    Date     Time    Name
  193. -------- ------- ----- --------- --------  -------------
  194.      628     275 56.2% 25-Sep-97 03:48:40  ged6indent.info
  195.     4847    1970 59.3% 05-Aug-99 00:57:48 +ged6findent.ged
  196.      519     290 44.1% 25-Sep-97 03:49:24 +ged6findent.ged.info
  197.     2612    1239 52.5% 05-Aug-99 00:57:58 +ged6indent.ged
  198.      519     286 44.8% 25-Sep-97 03:48:20 +ged6indent.ged.info
  199.     5589    2609 53.3% 05-Aug-99 01:58:12 +ged6indent.readme
  200.      468     239 48.9% 25-Sep-97 03:49:08 +ged6indent.readme.info
  201. -------- ------- ----- --------- --------
  202.    15182    6908 54.4% 06-Aug-99 14:13:26   7 files
  203.